package utils

import "time"

var Location = time.FixedZone("GMT", 8*3600)

const (
	LayoutGeneral = "2006-01-02 15:04:05"
)

// 时间戳转化str
func Time2str(sec int64) string {
	var t time.Time
	if sec == 0 {
		return ""
	} else {
		t = time.Unix(sec, 0)
	}
	return t.In(Location).Format(LayoutGeneral)
}
